## Process this file with automake to produce Makefile.in

SUBDIRS = src 

EXTRA_DIST = autogen.sh gdcalc.glade2 gdcalc.glade2p gdcalc.spec.in gdcalc.rc doc/gdcalc.1 doc/dcalc.1 doc/manual_en.html gdcalc.desktop gdcalc.kdelnk 

DATE    := $(shell date '+%Y%m%d%H%M')

.PHONY: testrpm
testrpm: dist
	cp @PACKAGE@-@VERSION@.tar.gz $$(rpm --eval %_topdir)/SOURCES
	sed "s/Release:.*/&.${DATE}/" @PACKAGE@.spec > @PACKAGE@-beta.spec
	rpmbuild -ba @PACKAGE@-beta.spec

.PHONY: rpm
rpm: dist
	cp @PACKAGE@-@VERSION@.tar.gz $$(rpm --eval %_topdir)/SOURCES
	rpmbuild -ba @PACKAGE@.spec

dist-hook:
	if test -d $(srcdir)/pixmaps; then \
	  $(mkinstalldirs) $(distdir)/pixmaps; \
	  for pixmap in $(srcdir)/pixmaps/*; do \
	    if test -f $$pixmap; then \
	      $(INSTALL_DATA) $$pixmap $(distdir)/pixmaps; \
	    fi \
	  done \
	fi

install-data-local:
	@$(NORMAL_INSTALL)
	if test -d $(srcdir)/pixmaps; then \
	  $(mkinstalldirs) $(prefix)/share/pixmaps; \
	  $(mkinstalldirs) $(prefix)/share/icons; \
	  for pixmap in $(srcdir)/pixmaps/*; do \
	    if test -f $$pixmap; then \
	      $(INSTALL_DATA) $$pixmap $(prefix)/share/pixmaps; \
	      $(INSTALL_DATA) $$pixmap $(prefix)/share/icons; \
	    fi \
	  done \
	fi
	$(mkinstalldirs) $(prefix)/share/applications
	cp  $(srcdir)/gdcalc.desktop $(prefix)/share/applications

.PHONY: help
help:
	@echo "Available targets include:"
	@echo "all       : the normal make (default)"
	@echo "check     : runs tests (if any)"
	@echo "clean     : cleans the directory"
	@echo "install   : installs into the directories specified in 'configure'"
	@echo "uninstall : uninstalls from those same directories"
	@echo "distclean : cleans anything that configure created"
	@echo "release   : to tag the repository with the current version - consider"
	@echo "            incrementing the version in configure.ac first."
	@echo "rpm       : builds an RPM package"
